package com.manager.model;

import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(name="tb_message")
public class Message extends AllId{

    private BigDecimal timeInterval;

    private Integer packageNum;

    private String storageLocation;

    private String networkCardName;

    private List<MessageSpecific> messageSpecificList = new ArrayList<>();

    @OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "message")
    public List<MessageSpecific> getMessageSpecificList() {
        return messageSpecificList;
    }

    public void setMessageSpecificList(List<MessageSpecific> messageSpecificList) {
        this.messageSpecificList = messageSpecificList;
    }

    public BigDecimal getTimeInterval() {
        return timeInterval;
    }

    public void setTimeInterval(BigDecimal timeInterval) {
        this.timeInterval = timeInterval;
    }

    public Integer getPackageNum() {
        return packageNum;
    }

    public void setPackageNum(Integer packageNum) {
        this.packageNum = packageNum;
    }

    public String getStorageLocation() {
        return storageLocation;
    }

    public void setStorageLocation(String storageLocation) {
        this.storageLocation = storageLocation;
    }

    public String getNetworkCardName() {
        return networkCardName;
    }

    public void setNetworkCardName(String networkCardName) {
        this.networkCardName = networkCardName;
    }
}
